package com.share.dubbo.wssh.web;

import com.share.common.common.Page;
import com.share.common.common.Result;
import com.share.dubbo.wssh.model.LogPageReq;
import com.share.dubbo.wssh.model.LogReq;
import com.share.dubbo.wssh.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class LogController {

    @Autowired
    private LogService logService;

    @RequestMapping("/accessLog/insert")
    public Result insert(LogReq req) {
        int status = logService.insert(req);
        return Result.insertOrDeleteOrUpdate(status);
    }

    @RequestMapping("/accessLog/pageList")
    public Result pageList(LogPageReq req) {
        Page page = logService.pageList(req);
        return Result.success(page);
    }
}
